package com.cy.pj.common.util;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import javax.servlet.http.HttpServletRequest;

/**
 * @DATE: 2021/3/16 14:24
 * @Author: LuckyH
 */
public class PageUtil {
    public static <T> Page<T> startPage(){
        HttpServletRequest request = ServletUtil.getHttpServletRequest();
        String pageCurrentstr = request.getParameter("pageCurrent");
        String pageSizestr = request.getParameter("pageSize");

        Integer pageCurrent=StringUtil.isEmpty(pageCurrentstr)?1:Integer.parseInt(pageCurrentstr);

        Integer pageSize=StringUtil.isEmpty(pageSizestr)?10:Integer.parseInt(pageSizestr);

        return PageHelper.startPage(pageCurrent,pageSize);

    }
}
